﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace dotnet_lab4
{
    class Program
    {
        static void Main(string[] args)
        {

            int size = 11;

            GrowableArray ga = new GrowableArray(size);
            Console.WriteLine("growable array should be 10. it is: " + ga.toString());

            ga[9] = 222;

            for (int i = 0; i < size; i++)
            {
                Console.WriteLine("ga[{0}]:{1}", i, ga[i]);
            }
            Console.WriteLine(ga.toString());


            Console.WriteLine("----------------------------");

            Fraction f1 = new Fraction();
            f1.Denominator = 2;
            f1.Numerator = 4;

            Fraction f2 = new Fraction();
            f2.Denominator = 15;
            f2.Numerator = 7;

            Fraction f3 = new Fraction();
            f3.Denominator = 1;
            f3.Numerator = 1;

           



            ArrayList arr1 = new ArrayList();
            arr1.Add(f1);
            arr1.Add(f2);
            arr1.Add(f3);

            //Fraction[] arr1 = new Fraction[] { f1, f2, f3 };
            

            foreach (Fraction f in arr1)
            {
                Console.Write(f.toString() + " ");
            }



            arr1.Sort();

            

            Console.WriteLine("Sorted: ");
           
            foreach (Fraction f in arr1)
            {
                Console.Write(f.toString() + " ");
            }



            Console.ReadKey();

        }
    }
}
